package com.resource.converter;

import com.resource.dto.OfficeProjectTaskDto;
import com.resource.request.OfficeProjectTaskRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 泛微系统项目任务请求对象转换
 *
 * @author jianghao.zhang
 */
@Mapper(componentModel = "spring")
public interface ProjectTaskConverter {

    /**
     * 将response转成dto
     *
     * @param request
     * @return OfficeProjectTaskDto dto
     */
    @Mappings({
            @Mapping(source = "name", target = "task_name"),
            @Mapping(source = "beginDate", target = "task_begintime"),
            @Mapping(source = "endDate", target = "task_endtime"),
            @Mapping(source = "description", target = "task_explain"),
            @Mapping(source = "remarks", target = "task_remark"),
    })
    OfficeProjectTaskDto requestToDto(OfficeProjectTaskRequest request);
}
